# -*- coding: utf-8 -*-

'''
Created on 01.06.2011

@author: Vlasov A. I. <root@proscript.ru>
'''
from django import template

register = template.Library()

@register.simple_tag(takes_context=True)
def statement_state(context):
    #raise template.TemplateSyntaxError(context)
    try:
        statement = context['request'].session['statement']
    #raise Exception(statement)
        context['edit_state'] = True
        
        if statement.user == context['request'].user:
            context['same_user'] = True
    except Exception:
        pass
        
    return ''